home *** CD-ROM | disk | FTP | other *** search
- <!-- Pack DTD
- !
- ! A zap pack ('pack') is an XML document, that should conform to this DTD (it is an
- ! instance of this DTD). This should be specified in the pack by its using
- ! the following two header lines:
- !
- ! <?xml version="1.0" encoding="utf-8">
- ! <!DOCTYPE pack SYSTEM "zapper.dtd">
- !
- ! The main element of the pack is of type <pack>.
- ! Comments are allowed in packs, using the standard syntax for XML comments.
- !
- ! It is customary to place a comment at the beginning of the pack to list
- ! the pack author, copyright, &c.
- -->
-
- <!ELEMENT pack (desc,external?,hier,zaplet+)>
-
- <!-- Pack attributes: version, title, url
- !
- ! The version describes the DTD version; it is currently (27-3-2000) at version 3.0.
- !
- ! A pack must have a title, which is used to identify it in the packs list.
- ! It is also displayed on the opened Zapper.
- ! The pack title is a mandatory attribute of the pack element.
- !
- ! A pack may also specify a URL. This URL should point to a location (probably
- ! the canonical location) from which this pack can be downloaded. If no URL is
- ! specified, the pack is never refreshed.
- -->
- <!ATTLIST pack
- version CDATA #REQUIRED
- title CDATA #REQUIRED
- url CDATA #REQUIRED>
-
- <!-- Pack identity
- !
- ! The initial section of the pack contains global information for this pack.
- !
- ! The global information contains:
- ! * The <desc> element contains a description of this pack.
- !
- ! It may be worthwhile to introduce a <common> tag here, which will contain functions
- ! to be used by all of the zaplets in this pack (`global' definitions). However,
- ! this requires careful thought about language issues, such as the interaction with
- ! zaplets in other languages than JavaScript (see below in the commentary for the
- ! <script> tag).
- -->
- <!ELEMENT desc (#PCDATA)>
- <!ELEMENT external (#PCDATA)> <!--internal-->
-
- <!-- Zapper hierarchy
- !
- ! The second section of the pack is the zapper hierarchy to use for it.
- ! The hierarchy references zaplets by their url; all of the zaplets referred to
- ! must also be included in the pack (in its third section). Also, the label to use
- ! for each zaplet should be specified in the hierarchy (it will default to the
- ! zaplet title).
- -->
- <!ELEMENT hier (folder|glref)+>
- <!ATTLIST glref
- url CDATA #REQUIRED
- label CDATA #IMPLIED
- tip CDATA #IMPLIED>
- <!ELEMENT folder (folder|glref)*>
- <!ATTLIST folder
- label CDATA #REQUIRED
- tip CDATA #IMPLIED>
-
- <!-- Zaplets
- !
- ! Following the identification part of the pack are the actual zaplets.
- ! A pack should contain _at_least_ one zaplet.
- !
- ! A zaplet has the following attributes:
- ! * url - a globally unique ID for this zaplet; this is composed of the original parent
- ! pack's URL, concatenated with a sharp sign ('#') and a unique identifier
- ! inside this pack (which may be any valid XML ID). The initial ID for a
- ! zaplet is created from its title.
- ! (The initial part of the URL, up to the '#' sign, may be omitted if it is
- ! equal to the pack's URL).
- ! * title - title for this zaplet; this is also used as the default label.
- ! * type - zaplet type; this should be "normal" for a zaplet that uses only
- ! the user's selection, "bookmark" for a zaplet that doesn't require
- ! a selection, or "extended" for a zaplet that uses the context.
- !
- ! The contents of a zaplet is a script (mandatory) and a description (optional).
- ! If a description is specified, it is a simple text item; it is displayed in the
- ! description part of the zapper. A substring of the description enclosed in a
- ! '%['..'%]' pair will be replaced with the contents of the edit box on display.
- ! Scripts are described in more detail later on.
- -->
- <!ELEMENT zaplet (script,desc?,external?)>
- <!ATTLIST zaplet
- url CDATA #IMPLIED
- title CDATA #REQUIRED
- type (normal|bookmark|extended) "normal">
-
- <!-- Zaplet scripts
- !
- ! A zaplet must have some some executable contents; this content is what actually
- ! gets executed when the user selects the zaplet. This will generally be some
- ! `function' of the text and context, and return an HTML result to the browser (or
- ! an HTTP request, which should be performed to get this result).
- ! Since the scripts may contain characters that are considered as markup by XML,
- ! they should be encolsed in a CDATA element (like
- !
- ! <script lang="javascript"><![CDATA[
- ! ...
- ! ]]></script>
- !
- ! The only script language currently supported is JavaScript.
- ! * lang="javascript" - the script is a JavaScript function (usually called "zaplet"),
- ! which is invoked with two parameters: the text and the context. A function name
- ! name different than "zaplet" may be specified by using a comment line of the form
- !
- ! //@* function: NAME
- !
- ! as the first line of the script.
- !
- ! Other script languages (like Perl) may be added in the future. Also, supporting
- ! more `full-featured' languages (Java) may be a good idea; however, to do this will
- ! require some mechanism for packaging the class files with the pack.
- ! Another problem is the interaction of multiple-language support with the suggested
- ! <common> block.
- -->
- <!ELEMENT script (#PCDATA)>
- <!ATTLIST script
- lang (javascript) #REQUIRED>
-